<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js?v=1"></script>
<script>
$(function(){
    $.ajax({
        url: '/mobile/wsd/',
        data: {
            "csrfmiddlewaretoken": $("body").attr("data-csrf"),
            'url': window.location.href
        },
        type: 'POST',
        success: function(data){
            wx.config({
                {% if debug %}
                debug: true,
                {% endif %}
                beta: true,
                appId: data.appid,
                timestamp: data.timestamp,
                nonceStr: data.nonceStr, 
                signature: data.signature,
                jsApiList: [
                    'onMenuShareTimeline',
                    'onMenuShareAppMessage',
                    'onMenuShareQQ',
                    'onMenuShareWeibo',
                    'startRecord',
                    'stopRecord',
                    'onVoiceRecordEnd',
                    'playVoice',
                    'pauseVoice',
                    'stopVoice',
                    'onVoicePlayEnd',
                    'uploadVoice',
                    'downloadVoice',
                    'chooseImage',
                    'previewImage',
                    'uploadImage',
                    'downloadImage',
                    'translateVoice',
                    'getNetworkType',
                    'openLocation',
                    'getLocation',
                    'hideOptionMenu',
                    'showOptionMenu',
                    'hideMenuItems',
                    'showMenuItems',
                    'hideAllNonBaseMenuItem',
                    'showAllNonBaseMenuItem',
                    'closeWindow',
                    'scanQRCode',
                    'chooseWXPay',
                    'openProductSpecificView',
                    'addCard',
                    'chooseCard',
                    'getInstallState',
                    'launch3rdApp',
                    'openCard'
                ]
            });
        }
    });
});
</script>